<?php

App::uses('AppModel', 'Model');

class AreaModel extends Model {
    public $useTable = 'm_area';

    // Use primaryKey
    public $primaryKey = 'id';

    public function getInfoFrmArea($mode) {
        $params = array();
        // Set fields params
        $params['fields'] = array(
        						   'AreaModel.id',
        						   'AreaModel.area_cd',
                                   'AreaModel.area_name');
		if ($mode != 'list')  {								   
	        // Set condition params
	        $params['conditions'] = array('OR' => array('AreaModel.area_cd is null',
	                                                    'AreaModel.area_name is null')
	                                     );
		}
        return $this->find('all', $params);
    }
}
